package com.clkj.aimin.dao.doctor;

import com.clkj.aimin.pojo.doctor.DoctorTalk;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author yawang
 * @create 2024/04/03 10:32:20
 **/
@Repository
public interface DoctorTalkMapper extends Mapper<DoctorTalk> {

    @Select("select a.*,b.user_name,b.user_img from t_cl_doctorTalk a left join t_cl_user b on a.user_id = b.user_id where a.doctor_id = #{doctorId} order by talk_id desc ")
    List<DoctorTalk> listTalksByDoctor(@Param("doctorId")Integer doctorId);

    @Select("select user_id  from t_cl_doctorTalk  where doctor_id = #{doctorId} group by user_id ")
    List<DoctorTalk> listTalks(@Param("doctorId") Integer doctorId);

}
